const http = require('http');
const url = require('url');
const zlib = require('zlib');
http.createServer(onRequest).listen(8080);
// console.log(Buffer.byteLength('怎么回事', 'utf-8'))
function onRequest(request, response) {
    var data = '123456';
    console.log(url.parse(request.url))
    response.writeHead(200, {
        'Content-Type': 'text/plain',
        'Content-Length': Buffer.byteLength(data, 'utf-8')
    });
    response.end(data);

}